Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming
نویسندگان
چکیده
Cooperative task management can provide program architects with ease of reasoning about concurrency issues. This property is often espoused by those who recommend “event-driven” programming over “multithreaded” programming. Those terms conflate several issues. In this paper, we clarify the issues, and show how one can get the best of both worlds: reason more simply about concurrency in the way “event-driven” advocates recommend, while preserving the readability and maintainability of code associated with “multithreaded” programming. We identify the source of confusion about the two programming styles as a conflation of two concepts: task management and stack management. Those two concerns define a two-axis space in which “multithreaded” and “event-driven” programming are diagonally opposite; there is a third “sweet spot” in the space that combines the advantages of both programming styles. We point out pitfalls in both alternative forms of stack management, manual and automatic, and we supply techniques that mitigate the danger in the automatic case. Finally, we exhibit adaptors that enable automatic stack management code and manual stack management code to interoperate in the same code base.
منابع مشابه
Cooperative Task Management Without Manual Stack Management
Perhaps the better of the two is the subtitle for this paper. The idea here is to effectively combine multithreaded programming with event-based programming in order to achieve the 'best of both worlds' concept. Simply, you want to achieve the ease of reasoning allowed for concurrency in the 'even-driven' model, while preserving the readability and maintainability of code associated with 'multi...
متن کاملSIMPLIFYING CONCURRENT PROGRAMMING IN SENSORNETS WITH THREADING pdfauthor
Wireless sensor networks (sensornets) are deeply embedded, resource constrained, distributed systems. Sensornets are generally developed in an interrupt(or event-) driven programming model. Writing event-driven programs is hard. Sensornets are generally battery powered, desiring event-driven executions, for power efficiency. This thesis presents TinyThread a safe, lightweight threading model wh...
متن کاملSolving a Two-Period Cooperative Advertising Problem Using Dynamic Programming
Cooperative advertising is a cost-sharing mechanism in which a part of retailers' advertising investments are financed by the manufacturers. In recent years, investment among advertising options has become a difficult marketing issue. In this paper, the cooperative advertising problem with advertising options is investigated in a two-period horizon in which the market share in the second period...
متن کاملA state based programming model for wireless sensor networks
Sensor nodes are small, inexpensive, and programmable devices that combine an autonomous power supply with computing, sensing, and wireless communication capabilities. Networks of sensor nodes can be deployed in the environment at a large scale to unobtrusively monitor phenomena of the real world. Wireless sensor networks are an emerging field of research with many potential applications. So fa...
متن کاملNew scheduling rules for a dynamic flexible flow line problem with sequence-dependent setup times
In the literature, the application of multi-objective dynamic scheduling problem and simple priority rules are widely studied. Although these rules are not efficient enough due to simplicity and lack of general insight, composite dispatching rules have a very suitable performance because they result from experiments. In this paper, a dynamic flexible flow line problem with sequence-dependent se...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2002